FileExists Function

public function FileExists(file) result(exists)

returns TRUE if file exists

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: file

Return Value logical


Source Code

FUNCTION FileExists &
!
(file) &
!
RESULT (exists)

IMPLICIT NONE

!Arguments with intent(in):
CHARACTER (LEN = *), INTENT(IN) :: file 

! Local declarations:  
LOGICAL                    :: exists
!------------end of declaration------------------------------------------------

 INQUIRE(FILE = file, EXIST = exists)
  
 RETURN
END	FUNCTION FileExists